package com.example.order.app.service.impl;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.example.order.app.service.IOrderService;
import org.springframework.stereotype.Service;

@Service
public class IOrderServiceImpl implements IOrderService {

    @Override
    @SentinelResource(value = "getOrder", fallback = "orderFallback")
    public String getOrder() {
        return "order service";
    }

    /**
     * getOrder方法sentinel服务保护处理
     * @return
     */
    public String orderFallback() {
        return "IOrderService#orderFallback()限流机制已触发,请勿频繁调用该方法";
    }

}
